package com.shopping.mall.core.module.instrumentPanel.entity;

import com.shopping.mall.base.state.OrderState;
import lombok.Data;

import java.util.List;

@Data
public class OrderNum {
    private int allNum;
    private int noPayNum;
    private int payNum;
    private int sendNum;
    private int finishNum;
    private int todayNum;
    private List<HourOrderNum> hourOrderNums;

    public void setOrderStateNum(List<OrderStateNum> orderStateNumList) {
        for(OrderStateNum orderStateNum:orderStateNumList){
            if(orderStateNum.getState()== OrderState.START.getValue()){
                noPayNum=orderStateNum.getNum();
            }else if(orderStateNum.getState()==OrderState.COPY_SUCCESS.getValue()){
                payNum=orderStateNum.getNum();
            }else if(orderStateNum.getState()==OrderState.GOOD_HAS_SEND.getValue()){
                sendNum=orderStateNum.getNum();
            }else if(orderStateNum.getState()==OrderState.ORDER_FINISH.getValue()){
                finishNum=orderStateNum.getNum();
            }
        }
    }
}
